/**
 * @Title: ShopOrderController.java
 * @Package com.lemon.controller.cityRun
 * @Description: (一句话阐述):
 * @author Ran_cc
 * @date 2018年10月26日
 * @version V1.0
 */
package com.lemon.controller.cityRun;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lemon.conf.MyException;
import com.lemon.conf.MyInterceptor.LoginRequired;
import com.lemon.conf.content.IdTypeHandler;
import com.lemon.controller.BaseController;
import com.lemon.mapper.cityRun.CrShopOrdersMapper;
import com.lemon.mapper.cityRun.CrShopUserMapper;
import com.lemon.mapper.cityRun.CrShopsMapper;
import com.lemon.mapper.cityRun.CrUserTransactionRecordMapper;
import com.lemon.model.buy.PayRefundResult;
import com.lemon.model.cityRun.CrShopOrderComment;
import com.lemon.model.cityRun.CrShopOrderGoods;
import com.lemon.model.cityRun.CrShopOrders;
import com.lemon.model.cityRun.CrShops;
import com.lemon.service.cityRun.CrShopOrderService;
import com.lemon.service.cityRun.CrShopUserService;
import com.lemon.service.cityRun.CrShopsService;
import com.lemon.service.cityRun.ShopPrintService;
import com.lemon.utils.CityRunUtils;
import com.lemon.utils.ReqResult;
import com.lemon.utils.StringUtil;
import com.lemon.utils.pay.Constants;
import com.lemon.utils.pay.PayUtil;
import com.lemon.utils.sval.StaticValues;

/**
 * <p>
 * Title: ShopOrderController
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author Ran_cc
 * @date 2018年10月26日
 * @版本 V 1.0
 */
@RestController
@RequestMapping("/order")
public class ShopOrderController extends BaseController {
	@Resource
	private CrShopOrderService orderService;

	@Resource
	private CrShopsService sService;

	@Resource
	private ShopPrintService printService;

	@Resource
	private CrShopUserService uService;

	@Resource
	private CrShopOrdersMapper orderMapper;
	@Resource
	private CrShopsMapper shopMapper;

	@Resource
	private CrUserTransactionRecordMapper transMapper;

	@Resource
	private CrShopUserMapper uMapper;

	////////////////////////////商品信息///////////////////////////////////
	@RequestMapping("/getOrdersList2")
	public ReqResult getOrdersList2(@ModelAttribute CrShopOrders order , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			log.info("查询订单列表2...");
			String stat = request.getParameter("state");
			if (StringUtil.isNotBlank(stat)) {
				order.setStatus(Integer.parseInt(stat));
			} else {
				order.setWhereAppend(
						" and (a.status =4 or a.status = 5 or a.status = 51 or a.status = 52 or a.status = 6 or a.status = 61 )");
			}
			String start = request.getParameter("startTime");
			String end = request.getParameter("endTime");
			if (StringUtil.isNotBlank(start) && StringUtil.isNotBlank(end)) {
				order.setWhereAppend(" and a.create_time >= ?" , start);
				order.setWhereAppend(" and a.create_time < ?" , StringUtil.addDateHour(end + " 00:00:00" , 24));
			} else if (StringUtil.isNotBlank(start)) {
				order.setWhereAppend(" and a.create_time >= ?" , start);
			} else if (StringUtil.isNotBlank(end)) {
				order.setWhereAppend(" and a.create_time < ?" , StringUtil.addDateHour(end + " 00:00:00" , 24));
			}
			order.setOrderBy(" order by a.create_time desc");
			List<CrShopOrders> list = orderService.selectListBySelective(order);
			reqResult.setReturnResult(list);
		} catch (Exception e) {
			MyException.writeErr(e , "");
			reqResult.setReturnResult("获取订单列表异常" , ReqResult.code_error);
		}
		return reqResult;
	}
	/**
	 * <b>Description:<blockquote> 查询订单列表
	 * </blockquote></b>
	 * 
	 * @Title: getGoodsList
	 * @param go
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月23日
	 */
	@RequestMapping("/getOrdersList")
	public ReqResult getOrdersList(@ModelAttribute CrShopOrders order , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			log.info("查询订单列表...");
			if (order.getStatus() != null && 3 == order.getStatus()) {
				order.setStatus(null);
				order.setWhereAppend(" and (a.status = 3 or a.status = 31 or a.status = 32  )");
			}
			String start = request.getParameter("startTime");
			String end = request.getParameter("endTime");
			if (StringUtil.isNotBlank(start) && StringUtil.isNotBlank(end)) {
				order.setWhereAppend(" and a.create_time >= ?" , start);
				order.setWhereAppend(" and a.create_time < ?" , StringUtil.addDateHour(end + " 00:00:00" , 24));
			} else if (StringUtil.isNotBlank(start)) {
				order.setWhereAppend(" and a.create_time >= ?" , start);
			} else if (StringUtil.isNotBlank(end)) {
				order.setWhereAppend(" and a.create_time < ?" , StringUtil.addDateHour(end + " 00:00:00" , 24));
			} else {
			}
			if (StringUtil.isNotBlank(order.getStartDate())) {
				order.setStatus(null);
				order.setWhereAppend(" and a.status = 4  and a.create_time like concat('%',?,'%') " ,
						order.getStartDate());
			} else {
				if (order.getStatus() != null && (4 == order.getStatus())) {
					//						order.setWhereAppend(" and  (a.status != 0 and  a.status != 4  and a.status != 5 )");
				} else if (order.getStatus() != null && 5 == order.getStatus()) {
					order.setStatus(null);
					order.setWhereAppend(" and ( a.status = 51 or a.status = 5  or a.status = 52 or a.status = 6  ) ");
				} else if (order.getStatus() != null && 2 == order.getStatus()) {
					//						order.setWhereAppend(" and ( a.create_time >= ? )" , CityRunUtils.getBusineDateString());
				} else if (order.getStatus() != null && 1 == order.getStatus()) {
					//						order.setWhereAppend(" and ( a.create_time >= ? )" , CityRunUtils.getBusineDateString());
				} else {
					//						order.setStatus(null);
					//						order.setWhereAppend(" and ( a.create_time >= ?" , CityRunUtils.getBusineDateString());
					//						order.setWhereAppend(" or  (a.status != 0 and  a.status != 4  and a.status != 5 ))");
				}
			}
			String onm = request.getParameter("orderName");
			if (StringUtil.isNotBlank(onm)) {
				order.setWhereAppend(
						" and ( a.user_name like concat('%',?,'%') or  a.order_no like concat('%',?,'%') )" , onm ,
						onm);
			}

			order.setOrderBy(" order by a.create_time desc");

			if (StringUtil.isNotBlank(order.getUserName())) {
				try {
					order.setUserName(IdTypeHandler.decode(order.getUserName()) + "");
					order.setWhereAppend(" and ( a.status = 32 or a.status = 3  )");
				} catch (Exception e) {

				}
			}
			List<CrShopOrders> list = orderService.selectListBySelective(order);

			boolean flag = true;
			while (flag) {
				if (list.size() == 0) {
					flag = false;
					break;
				}
				System.out.println(list.size());
				for (CrShopOrders ord : list) {

					log.info("开始判断状态:{}," , ord.getStatus());

					int time = 2;
					if (ord.getType() == 2) {
						time = 4;
					}
					if ((ord.getStatus() == 3 || ord.getStatus() == 31 || ord.getStatus() == 32)
							&& StringUtil.addDateHour(ord.getCreateTime() , time).getTime() < new Date().getTime()) {
						CrShopOrders ss = new CrShopOrders();
						ss.setId(ord.getId());
						ss.setStatus(4);
						int info = orderService.updateOrderInfo(ss);
						//					boolean remove = list.remove(list.get(i));
						boolean remove = list.remove(ord);
						log.info(remove + "");
						flag = true;
						break;
					} else if (ord.getStatus() == 2
							&& StringUtil.addDateMinute(ord.getCreateTime() , 15).getTime() < new Date().getTime()) {
						CrShopOrders ss = new CrShopOrders();
						ss.setId(ord.getId());
						ss.setStatus(52);
						int info = orderService.updateOrderInfo(ss);
						//list.remove(list.get(i));
						boolean remove = list.remove(ord);
						flag = true;
						break;
					}
					flag = false;
				}
			}

			log.info(list.size() + "");

			for (CrShopOrders ord : list) {
				String mark = ord.getMark();
				if (StringUtil.isNotBlank(mark)) {
					if (mark.indexOf("$&#$") > 0) {
						if (ord.getType() == 1) {
							mark = mark.replace("$&#$" , "/") + "份餐具";
						} else {
							mark = mark.substring(0 , mark.indexOf("$&#$"));
						}
					} else if (mark.trim().indexOf("$&#$") == 0) {
						if (ord.getType() == 1) {
							mark = mark.replace("$&#$" , "") + "份餐具";
						} else {
							mark = "";
					}
				}
					ord.setMark(mark);
				}

				String id = ord.getId();
				CrShopOrderGoods ogo = new CrShopOrderGoods();
				ogo.setOrderId(id);
				List<CrShopOrderGoods> li = orderService.selectOrderGoodsListBySelective(ogo);
				ord.setList(li);
			}

			//			for (int i = 0; i < list.size(); i++) {
			//
			//				CrShopOrders ord = list.get(i);
			//
			//				int time = 2;
			//				if (ord.getType() == 2) {
			//					time = 4;
			//				}
			//				if (ord.getStatus() == 3
			//						&& StringUtil.addDateHour(ord.getCreateTime() , time).getTime() < new Date().getTime()) {
			//					CrShopOrders ss = new CrShopOrders();
			//					ss.setId(ord.getId());
			//					ss.setStatus(4);
			//					int info = orderService.updateOrderInfo(ss);
			//					if (info > 0) {
			//						list.remove(list.get(i));
			//					}
			//				} else if (ord.getStatus() == 2
			//						&& StringUtil.addDateMinute(ord.getCreateTime() , 15).getTime() < new Date().getTime()) {
			//					CrShopOrders ss = new CrShopOrders();
			//					ss.setId(ord.getId());
			//					ss.setStatus(52);
			//					int info = orderService.updateOrderInfo(ss);
			//					if (info > 0) {
			//						list.remove(list.get(i));
			//					}
			//				}
			//
			//
			//				String mark = list.get(i).getMark();
			//				if (StringUtil.isNotBlank(mark)) {
			//					if (mark.indexOf("$&#$") > 0) {
			//						if (ord.getType() == 1) {
			//							mark = mark.replace("$&#$" , "/") + "份餐具";
			//						} else {
			//							mark = mark.substring(0 , mark.indexOf("$&#$"));
			//						}
			//					} else if (mark.trim().indexOf("$&#$") == 0) {
			//						if (ord.getType() == 1) {
			//							mark = mark.replace("$&#$" , "") + "份餐具";
			//						} else {
			//							mark = "";
			//						}
			//					}
			//					list.get(i).setMark(mark);
			//				}
			//				String id = ord.getId();
			//				CrShopOrderGoods ogo = new CrShopOrderGoods();
			//				ogo.setOrderId(id);
			//				List<CrShopOrderGoods> li = orderService.selectOrderGoodsListBySelective(ogo);
			//				list.get(i).setList(li);
			//			}
			reqResult.setReturnResult(list.size() == 0 ? null : list);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	/**
	 * <b>Description:<blockquote> 修改订单信息
	 * </blockquote></b>
	 * 
	 * @Title: updateOrderInfo
	 * @param order
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年11月14日
	 */
	@RequestMapping("/updateOrderInfo.do")
	public ReqResult updateOrderInfo(@ModelAttribute CrShopOrders order , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			CrShopOrders order2 = orderService.selectByOrderId(order.getId());

			//判断订单的状态 ,如果是接单  
			if (order.getStatus() == 3) { //接单  2.0 修改成接单后就打印小票
				//				String string = RedisUtil.get("cityRun:set:set_" + order.getShopId());
				//				if (StringUtil.isNotBlank(string)) {
				//					JSONObject js = (JSONObject) JSONObject.parse(string);
				//				在判断是否自动打印 
				//					if (1 == js.getIntValue("printAuto")) {
				//				如果是微信支付就修改账户余额
				//				修改用户账户信息
				//						CrShopUser u = new CrShopUser();
				//						u.setWhere(" and b.id = ?  " , IdTypeHandler.decode(order.getShopId()));
				//						u = uService.selectBySelective(u);
				//						CrShopUser uu = new CrShopUser();
				//						uu.setId(u.getId());
				//						uu.setAmount(order.getPayPrice());
				//						int selective = uService.updateByPrimaryKeySelective(u);
				//判断状态是否已经改变了
				if (order2.getStatus() != 2) {
					reqResult.setReturnResult("状态发生改变,接单失败" , ReqResult.code_fail);
					return reqResult;
				} else if (order2.getStatus() == 2
						&& StringUtil.addDateMinute(order2.getCreateTime() , 15).getTime() < new Date().getTime()) {
					CrShopOrders ss = new CrShopOrders();
					ss.setId(order2.getId());
					ss.setStatus(52);
					int info = orderService.updateOrderInfo(ss);
					//list.remove(list.get(i));
					reqResult.setReturnResult("状态发生改变,接单失败" , ReqResult.code_fail);
					return reqResult;
				}
				try {
					printService.printerInfo(order2.getShopId() , order2.getId());
				} catch (Exception e) {
					MyException.writeErr(e , "打印机打印订单异常,订单编号:" + order2.getOrderNo());
				}
				//					}
				//				}
			}
			int list = orderService.updateOrderInfo(order);
			if (order.getStatus() == 5 && order2.getPayType() == 1) {
				//取消订单 并图款
				PayRefundResult result2 = PayUtil.refund(Constants.WeChatAPPID , order2.getOrderNo() ,
						order2.getOrderNo() , order2.getPayPrice() , order2.getPayPrice() , "");
				CrShopOrders or1 = new CrShopOrders();
				or1.setOrderNo(order2.getOrderNo());
				or1.setStatus(52);
				int row = orderMapper.updateOrderStatByPayOk(or1);
				if (row > 0) {
					order.setStatus(52);
					orderService.updateCelGoodsNum(order2);
					//添加订单流水线
					//					or1 = new CrShopOrders();
					//					or1.setOrderNo(order2.getOrderNo());
					//					CrShopOrders order1 = orderMapper.selectBySelective(or1);
					//					CrShopUser u = new CrShopUser();
					//					u.setWhere(" and b.id = ? " , IdTypeHandler.decode(order1.getShopId()));
					//					CrShopUser user = uMapper.selectBySelective(u);
					//					CrShops cs = new CrShops();
					//					cs.setShopUserId(user.getId());
					//					CrShops shop = shopMapper.selectBySelective(cs);
					//					CrUserTransactionRecord tran = new CrUserTransactionRecord();
					//					tran.setShopUserId(user.getId());
					//					tran.setShopAccount(user.getUserAccount());
					//					tran.setShopTitle(shop.getShopTitle());
					//					tran.setShopId(shop.getId());
					//					tran.setSerialNumber(order2.getOrderNo());
					//					tran.setAmount(order2.getPayPrice());
					//					tran.setStatus(1);
					//					tran.setType(1);
					//					tran.setTranType(1);
					//					transMapper.insertSelective(tran);
				}
			} else if (order.getStatus() == 5) {
				//				if (order2.getStatus() >= 1 && order2.getStatus() <= 2) {
				CrShopOrders or = new CrShopOrders();
				or.setId(order.getId());
				or.setStatus(52);
				int row = orderService.updateOrderInfo(or);
				if (row > 0) {
					reqResult.setReturnResult(row);
				} else {
					reqResult.setReturnResult("修改失败" , ReqResult.code_fail);
				}
				//				}
			}
			reqResult.setReturnResult(1);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	@RequestMapping("/selectOrderProfitToday")
	public ReqResult selectOrderProfitToday(@ModelAttribute CrShopOrders order , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			order.setWhereAppend(" and a.create_time >= ?" , CityRunUtils.getBusineDateString());
			order.setWhereAppend(" and ( a.status  = 4 or a.status = 3 or a.status = 31 or a.status = 32  ) ");
			//order.setOrderBy(" order by a.create_time desc");
			List<Map<String , Object>> list = orderService.selectOrderProfitToday(order);
			reqResult.setReturnResult(list);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	@RequestMapping("/updateOrderInfoTable.do")
	public ReqResult updateOrderInfoTable(String tabId , HttpServletRequest request , HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			CrShopOrders orders = new CrShopOrders();
			orders.setUserName(IdTypeHandler.decode(tabId) + "");
			orders.setWhereAppend(" and ( a.status = 32 or a.status = 31 or a.status = 3  )");
			List<CrShopOrders> list = orderService.selectListBySelective(orders);
			for (int i = 0; i < list.size(); i++) {
				CrShopOrders or = list.get(i);
				orders = new CrShopOrders();
				orders.setId(or.getId());
				orders.setStatus(4);
				int row = orderService.updateOrderInfo(orders);
				reqResult.setReturnResult(row);
			}
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	///////////////////订单评论////////////////////////
	/**
	 * <b>Description:<blockquote> 查询评价列表
	 * </blockquote></b>
	 * 
	 * @Title: getGoodsList
	 * @param go
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月23日
	 */
	@RequestMapping("/getOrderCommentList")
	public ReqResult getOrderCommentList(@ModelAttribute CrShopOrderComment comment , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {

			//星级查询 
			String star = request.getParameter("starStr");
			//有无内容
			String hsa = request.getParameter("hasCon");

			StringBuffer buffer = new StringBuffer();
			if ("1".equals(hsa)) {
				buffer.append(" and a.content is not null");
			} else if ("2".equals(hsa)) {
				buffer.append(" and a.content is null");
			}

			if (StringUtil.isNotBlank(star)) {
				buffer.append(" and a.comment_star in (");
				buffer.append(star);
				buffer.append(")");
			}
			//时间条件
			String s = request.getParameter("startTime");
			String e = request.getParameter("endTime");
			if (StringUtil.isNotBlank(s) && StringUtil.isNotBlank(e)) {
				buffer.append(" and a.create_time  > '");
				buffer.append(s);
				buffer.append("' and a.create_time  < '");
				buffer.append(e);
				buffer.append("' ");
			} else if (StringUtil.isNotBlank(s)) {
				buffer.append(" and a.create_time  > '");
				buffer.append(s);
				buffer.append("' ");
			} else if (StringUtil.isNotBlank(e)) {
				buffer.append(" and a.create_time  < '");
				buffer.append(e);
				buffer.append("' ");
			}
			String spid = request.getParameter("shopId");
			buffer.append(" and b.shop_id = ");
			buffer.append(IdTypeHandler.decode(spid));

			buffer.append(" and a.status != 0 ");
			comment.setWhere(buffer.toString());
			comment.setOrderBy(" order by a.create_time desc");
			List<CrShopOrderComment> list = orderService.selectCommentsListBySelective(comment);
			for (int i = 0; i < list.size(); i++) {
				CrShopOrderGoods ogo = new CrShopOrderGoods();
				ogo.setOrderId(list.get(i).getOrderId());
				List<CrShopOrderGoods> li = orderService.selectOrderGoodsListBySelective(ogo);
				list.get(i).setList(li);
			}
			reqResult.setReturnResult(list);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	/**
	 * <b>Description:<blockquote> 修改订单评论
	 * </blockquote></b>
	 * 
	 * @Title: updateOrderCommentList
	 * @param comment
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年11月1日
	 */
	@LoginRequired
	@RequestMapping("/updateOrderCommentList.do")
	public ReqResult updateOrderCommentList(@ModelAttribute CrShopOrderComment comment , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			int row = orderService.updateCommentBySelective(comment);
			reqResult.setReturnResult(row);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	/**
	 * <b>Description:<blockquote> 查询财务对账每天的订单收入
	 * </blockquote></b>
	 * 
	 * @Title: updateOrderCommentList
	 * @param comment
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年11月1日
	 */
	@LoginRequired
	@RequestMapping("/getOrderProfitList")
	public ReqResult getOrderProfitList(@ModelAttribute CrShopOrders orders , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {

			String star = request.getParameter("startTime");
			String end = request.getParameter("endTime");
			StringBuffer buffer = new StringBuffer();

			if (StringUtil.isNotBlank(star) && StringUtil.isNotBlank(end)) {
				buffer.append(" and temp.date >='");
				buffer.append(star);
				buffer.append("' and temp.date <='");
				buffer.append(end);
				buffer.append("'");
			} else if (StringUtil.isNotBlank(star)) {
				buffer.append(" and temp.date >='");
				buffer.append(star);
				buffer.append("'");
			} else if (StringUtil.isNotBlank(end)) {
				buffer.append(" and temp.date <='");
				buffer.append(end);
				buffer.append("'");
			}

			CrShops shops = sService.selectShopById(orders.getShopId());
			//计算店铺注册时间到今天的天数
			int days = StringUtil.getDistanceDays(shops.getCreateTime() , new Date());
			orders.setProDays(days + "");
			orders.setStartDate(StringUtil.DateToString(shops.getCreateTime() , 0));
			orders.setWhere(buffer.toString());
			List<Map<String , Object>> list = orderService.getOrderProfitList(orders);
			reqResult.setReturnResult(list);
		} catch (Exception e) {
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	/**
	 * <b>Description:<blockquote> 获得商家首页的统计数据
	 * </blockquote></b>
	 * 
	 * @Title: getShopTodayFirgit
	 * @param orders
	 * @param request
	 * @param response
	 * @return
	 * @author Ran_cc
	 * @date 2018年11月10日
	 */
	@RequestMapping("/getShopTodayFirgit")
	public ReqResult getShopTodayFirgit(@ModelAttribute CrShopOrders orders , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();
		try {
			Date date = StringUtil.StringToDate(StaticValues.TODAY_TIME() , 4);
			Date date2 = new Date();
			if (date.getTime() > date2.getTime()) {
				orders.setCreateTime(StringUtil.StringToDate(StaticValues.YESTERDAY_TIME() , 4));
			} else {
				orders.setCreateTime(StringUtil.StringToDate(StaticValues.TODAY_TIME() , 4));
			}

			Map<String , Object> map = orderService.getShopTodayFirgit(orders);
			reqResult.setReturnResult(map);
		} catch (Exception e) {
			reqResult.setReturnResult("" , ReqResult.code_error);
			MyException.writeErr(e , "");
		}
		return reqResult;
	}

	public static void main(String[] args) {
		System.out.println(IdTypeHandler.decode("26o4v"));
	}

}
